
#include <avr/io.h>
#include "adc.h"

void adc_init(void){
	
	//Write code to initialize the ADC.
	ADMUX |= (1<<MUX1) | (1<<MUX2) | (1<<REFS0) | (1<<REFS1); //Select ADC6 with voltage reference
	ADCSRA |= (1<<ADEN); //Enables adc
	ADCSRA |= (1<<ADIE); //Enables interrupt when conversion completes

}

void adc_start(void){
	ADCSRA |= (1<<ADSC); //Starts adc conversion
}

void adc_off(){
	ADCSRA = 0b00000000;
}